(*--------------------------------------------------------
    Holt                  http://coderesearchlabs.com/holt
    by Javier Santo Domingo (j-a-s-d@coderesearchlabs.com)
  --------------------------------------------------------
    FreePascal emitter demo
  --------------------------------------------------------*)

library he_fp_demo;

const
  HE_NAME = 'fp_demo';
  HE_OK = '0';

var
  lastResult: ansistring;

function getName: pchar; cdecl;
begin
  result := HE_NAME;
end;

function getLevelKinds(_level: cardinal): pchar; cdecl;
begin
  result := '';
end;

function setDestination(_destination: pchar): pchar; cdecl;
begin
  lastResult := HE_OK;
  result := pchar(lastResult);
end;

function beginEmission: pchar; cdecl;
begin
  lastResult := HE_OK;
  result := pchar(lastResult);
end;

function endEmission: pchar; cdecl;
begin
  lastResult := HE_OK;
  result := pchar(lastResult);
end;

function emitNode(_level, _position, _childCount: cardinal;
  _path, _kind, _name, _value: pchar): pchar; cdecl;
begin
  lastResult := HE_OK;
  result := pchar(lastResult);
end;

exports
  getName,
  getLevelKinds,
  setDestination,
  beginEmission,
  endEmission,
  emitNode;
end.
